Skip to content

[MODORDERS-1311] Prevent unopening of order when related piece has a request#1252

Merged
damien-git merged 2 commits intomasterfrom
MODORDERS-1311
Mar 3, 2026
Merged

[MODORDERS-1311] Prevent unopening of order when related piece has a request#1252
damien-git merged 2 commits intomasterfrom
MODORDERS-1311

Conversation

@damien-git
Copy link
Contributor

@damien-git damien-git commented Mar 2, 2026

Purpose

MODORDERS-1311 - Prevent unopening of order when related piece has a request

Approach

  • Removed previous partial check during inventory processing
  • Added a new check during validation, for both “Delete holdings and items” and “Delete items”.
  • Moved processing call from OrderValidationService to PurchaseOrderHelper (processing is not validation)
  • Added a test for the new validation step

The logic is changed is subtle ways, the existence of requests is checked in more cases than before.

Disclaimer: I tested mod-orders and cross-module integration tests, but I was not able to run ECS tests. Also I was not able to test adding a request with the local dev environment UI, or check inventory.


Pre-Review Checklist

  • Self-reviewed Code — Reviewed code for issues, unnecessary parts, and overall quality.
  • Change Notes — NEWS.md updated with clear description and issue key.
  • Testing — Confirmed changes were tested locally or on dev environment.
  • Logging: Confirmed that logging is appropriately handled.
  • Breaking Changes — Handled all required actions if changes affect API, DB, or interface versions.
    • API/schema changes
    • Interface version updates
    • DB schema changes / migration scripts
  • New Properties / Environment Variables — Updated README.md if new configs were added.

@damien-git damien-git requested a review from a team as a code owner March 2, 2026 20:30
@damien-git damien-git self-assigned this Mar 2, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

HashMap<String, List<String>> tenantIdToPoLineIds = new HashMap<>();
poLines.forEach(poLine -> {
List<String> tenantIds = PoLineCommonUtil.getTenantsFromLocations(poLine);
tenantIds.forEach(tenantId -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this logic check requests from standalone non ecs tenants like diku? Location object will not have standalone tenants, so we should check them from request headers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with a null tenantId.

return processPoLines(compPO.getPoLines(), poLine -> processInventory(poLine, true, requestContext));
}

public Future<Void> checkRequests(CompositePurchaseOrder compPO, RequestContext requestContext) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

karate test can be written for non-ecs setup, for standalone tenants.
But in future we should improve running karate tests locally for the ECS, we have stories for it.

@damien-git damien-git merged commit dbeb2e0 into master Mar 3, 2026
4 checks passed
@damien-git damien-git deleted the MODORDERS-1311 branch March 3, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants